from time import sleep
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.wait import WebDriverWait

# 1.打开浏览器
driver = webdriver.Chrome(executable_path='../01/chromedriver.exe')
# driver = webdriver.Chrome() #创建浏览器对象
# 放大浏览器页面
driver.maximize_window()
# 2.输入访问地址（URL）
driver.get("http://121.43.169.97:8848/pageA.html")


# 暂停两秒
sleep(2)
# 滚动条拉到最底层
js = "window.scrollTo(0,10000)"
# 调用执行
driver.execute_script(js)

# 暂停两秒
sleep(2)
# 滚动条拉到最顶层
js2 = "window.scrollTo(0,0)"
# 调用执行
driver.execute_script(js2)